package pta.newch04.ex16;

import java.util.ArrayList;

public class Main{
    private ArrayList<Student> slist = new ArrayList<>();

    public void addStudent(Student s){
        this.slist.add(s);
    }

    public void showStudent(){
        for(Student s:slist){
            System.out.println(s);
        }
    }

    public static void main(String[] args) {
        Main t = new Main();
        t.addStudent(new Student("2016001","rose",18));
        t.addStudent(new Student("2016002","hunifu",19));
        t.addStudent(new Student("2016003","britsh",20));
        t.addStudent(new Student("2016004","sunni",17));
        t.showStudent();
    }
}

class Student {
    public Student(String id, String name, int age) {
        this.id = id;
        this.name = name;
        this.age = age;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }


    @Override
    public String toString() {
        return  id + " " + name + " " + age;
    }

    private String id;
    private String name;
    private int age;
}